
//
//	This file tests reporting of W300X errors
//

//
// W3001: Missing semicolon
//

doTest([
	'1\n' +
	'2'
], [
	[3001, 1, 1, 0],
	[3001, 2, 1, 0]
]);

doTest([
	'1;\n' +
	'2'
], [
	[3001, 2, 1, 0]
]);

doTest([
	'do{}while(0)1;'
], [
	[3001, 1, 13, 0]
]);

doTest([
	'"37" - 7 // returns 30\n' +
	'"37" + 7 // returns "377"'
], [
	[3001, 1, 8, 0],
	[3001, 2, 8, 0]
]);

doTest([
	'a.b = b\n' +
	'/**/\n' +
	'c();'
], [
	[3001, 1, 7, 0]
]);

//
// W3002: Accessing undefined variable
//


//
// W3003: Trailing comma at the end of object or array literal
//

doTest([
	'[,];'
], [
	[3003, 1, 2, 0]
]);

doTest([
	'[1 ,];'
], [
	[3003, 1, 4, 0]
]);

doTest([
	'[]; [1, 2];'
], []);

doTest([
	'({,});'
], [
	[3003, 1, 3, 0]
]);

doTest([
	'({ a: 1 , });'
], [
	[3003, 1, 9, 0]
]);

doTest([
	'({}, { a: 1, b: 2 });'
], []);

//
// W3004: Conditional compilation is not supported
//

doTest([
	'var a = /*@cc_on false && @*/ true;'
], [
	[3004, 1, 8, 0]
]);

//
// W3005: Future reserved keywords cannot be used as identifiers.
//
doTest([
	'function a(static) {\n' +
	'	this._static = null;\n' +
	'	this.static = static;\n' +
	'};'
], [
	[3005, 1, 12, 0],
	[3005, 3,  7, 0],
	[3005, 3, 16, 0]
]);
